//
//  BaseViewController.swift
//  HeadlineNews
//
//  Created by han on 2019/6/24.
//  Copyright © 2019 han. All rights reserved.
//

import UIKit

class BaseViewController: UIViewController {
    
    var presentDelegate : PresentDelegate?
    
    init() {
        super.init(nibName: nil, bundle: nil)
        initPresentDelegate()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        initPresentDelegate()
    }
    
    func initPresentDelegate() {
        presentDelegate = PresentDelegate(currentViewController: self)
        self.transitioningDelegate = presentDelegate
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        print("\(type(of: self)),\(#line),\(#function)")
        
        view.backgroundColor = UIColor.white
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        print("\(type(of: self)),\(#line),\(#function)")
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        print("\(type(of: self)),\(#line),\(#function)")
        
        updateStack()
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        print("\(type(of: self)),\(#line),\(#function)")
    }
    
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        print("\(type(of: self)),\(#line),\(#function)")
    }
    
    deinit {
        print("deinit \(type(of: self))")
    }
    
    @objc func updateStack() {
        
    }
}


